package es.udc.emarketapp.emarket.model.purchase.dao;

import es.udc.emarketapp.emarket.model.purchase.vo.PurchaseVO;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import java.sql.Connection;
import java.util.List;

public interface SQLPurchaseDAO {

    public PurchaseVO create(Connection connection, PurchaseVO purhaseVO)
            throws InternalErrorException;

    public boolean exists(Connection connection, Long nCompra)
            throws InternalErrorException;

    public PurchaseVO findById(Connection connection, Long nCompra)
            throws InstanceNotFoundException, InternalErrorException;

    public PurchaseVO findLastByClient(Connection connection, String idClient)
            throws InstanceNotFoundException, InternalErrorException;

    public List<PurchaseVO> findByClient(Connection connection, String idComprador,
            int startIndex, int count) throws InternalErrorException;

    public List<PurchaseVO> findAll(Connection connection,
            int startIndex, int count) throws InternalErrorException;

   public void updateValue(Connection connection, Long nCompra, double value)
            throws InstanceNotFoundException, InternalErrorException;

    public void update(Connection connection, PurchaseVO purchaseVO)
            throws InstanceNotFoundException, InternalErrorException;

    public void remove(Connection connection, Long nCompra)
            throws InstanceNotFoundException, InternalErrorException;
    /*
    public List<OrderVO> getOrders(Connection connection,
    int nCompra, int startIndex, int count)
    throws InstanceNotFoundException, InternalErrorException;
     */
}
